<div class="form-group clearfix">
  <div class="pull-left form-inline">
    <button type="button" class="btn btn-default" (click)="goBack()">返回</button>
  </div>
</div>


<form #addForm="ngForm">
  <div class="form-group clearfix">
    <label class="col-md-2"><span class="require-red">*</span>关键词名字</label>
    <div class="col-md-6">
      <input type="text" class="form-control" name="key" #number="ngModel" [(ngModel)]="addKeyWord.key" required
             (ngModelChange)="checkName($event)">
      <p [hidden]="!nameError" class="alert alert-danger">关键词不能为空!</p>
    </div>
  </div>
  <div class="form-group clearfix">
    <label class="col-md-2">排序</label>
    <div class="col-md-6">
      <input type="number" class="form-control" name="sort" [(ngModel)]="addKeyWord.sort"
             (ngModelChange)="checkSort($event)" required>
      <p [hidden]="!sortError" class="alert alert-danger">排序只能是非负整数</p>
    </div>
  </div>
</form>
<div class="col-md-8 text-center">
  <button class="btn btn-success" *ngIf="edit" [disabled]="!addForm.form.valid || addStatus" (click)="addKeyword()">{{
    addStatus ? '修改中' : '修改' }}
  </button>
  <button class="btn btn-success" *ngIf="!edit" [disabled]="!addForm.form.valid || addStatus" (click)="addKeyword()">{{
    addStatus ? '添加中' : '添加' }}
  </button>
  <button class="btn btn-success" type="reset" (click)="goBack();">取消</button>
</div>

<app-notification [type]="type" [message]="message" [isShow]="isShow"
                  (promptIsShow)="isShow = $event"></app-notification>
